

<script setup>
import { ref, watch } from "vue";
import { bankList } from "./bank.js";

let isShowBank = ref(false);

const props = defineProps({
	show: {
		type: Boolean,
		default: false,
	}
})

const emits = defineEmits(["confirm"])
// 银行弹窗确认按钮点击事件
const handleBankConfirm = (e) => {
	console.log("bank select", e)
	emits("confirm", e.value[0])
}

watch(() => props.show, (val) => {
	isShowBank.value = val;
})

</script>

<template>
	<!-- 选择银行弹窗 -->
	<u-picker
		:show="isShowBank"
		:columns="bankList"
		@cancel="isShowBank = false"
		@confirm="handleBankConfirm" />
</template>

<style>
</style>